﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.Text;

namespace EvidenceManagement.Workstation
{
    static class Program
    {
        enum HashingAlgorithms
        {
            MD5,
            SHA1,
            SHA256,
            SHA512
        };

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {

            //var name = HashingAlgorithms.SHA512;

            //var password = "LOCALSYSTEM";

            //var passwordBytes = Encoding.Unicode.GetBytes(password);

            //var saltBytes = new byte[passwordBytes.Length];

            //new RNGCryptoServiceProvider().GetNonZeroBytes(saltBytes);
            //var salt = Convert.ToBase64String(saltBytes);           

            //var bytesToEncrypt = passwordBytes.ToList();
            //bytesToEncrypt.AddRange(saltBytes);
            //HashAlgorithm algorithm = null;

            //switch (name)
            //{
            //    case HashingAlgorithms.MD5:
            //        algorithm = HashAlgorithm.Create("MD5");
            //        break;
            //    case HashingAlgorithms.SHA1:
            //        algorithm = HashAlgorithm.Create("SHA1");
            //        break;
            //    case HashingAlgorithms.SHA256:
            //        algorithm = HashAlgorithm.Create("SHA256");
            //        break;
            //    case HashingAlgorithms.SHA512:
            //        algorithm = HashAlgorithm.Create("SHA512");
            //        break;
            //}

            //var hashedValue = Convert.ToBase64String(algorithm.ComputeHash(bytesToEncrypt.ToArray()));

            var container = AutofacContainerBuilder.BuildContainer();
            
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);                        
            Application.Run(new frmMainForm());
        }
    }
}
